import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Stateless"),
      ),
      body: MyHomePageBody(),
    );
  }
}

class MyHomePageBody extends StatelessWidget {
  const MyHomePageBody({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        MyHomePageBodyItem("死神", "千年X战",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fatt.bbs.duowan.com%2Fforum%2Fmonth_0903%2F20090319_feb015c2cb8044176b7e1nCpYa1ubRqV.jpg&refer=http%3A%2F%2Fatt.bbs.duowan.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631756338&t=e0fcce399ca80ce300c92282fe7ab210"),
        MyHomePageBodyItem("死神", "千年X战",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fatt.bbs.duowan.com%2Fforum%2Fmonth_0903%2F20090319_feb015c2cb8044176b7e1nCpYa1ubRqV.jpg&refer=http%3A%2F%2Fatt.bbs.duowan.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631756338&t=e0fcce399ca80ce300c92282fe7ab210"),
        MyHomePageBodyItem("死神", "千年X战",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fatt.bbs.duowan.com%2Fforum%2Fmonth_0903%2F20090319_feb015c2cb8044176b7e1nCpYa1ubRqV.jpg&refer=http%3A%2F%2Fatt.bbs.duowan.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631756338&t=e0fcce399ca80ce300c92282fe7ab210"),
        MyHomePageBodyItem("死神", "千年X战",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fatt.bbs.duowan.com%2Fforum%2Fmonth_0903%2F20090319_feb015c2cb8044176b7e1nCpYa1ubRqV.jpg&refer=http%3A%2F%2Fatt.bbs.duowan.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631756338&t=e0fcce399ca80ce300c92282fe7ab210"),
        MyHomePageBodyItem("死神", "千年X战",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fatt.bbs.duowan.com%2Fforum%2Fmonth_0903%2F20090319_feb015c2cb8044176b7e1nCpYa1ubRqV.jpg&refer=http%3A%2F%2Fatt.bbs.duowan.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631756338&t=e0fcce399ca80ce300c92282fe7ab210"),
      ],
    );
  }
}

Widget MyHomePageBodyItem(String title, String subTitle, String imageStr) {
  return Container(
    padding: EdgeInsets.all(10),
    decoration: BoxDecoration(
        color: Colors.green, border: Border.all(width: 3, color: Colors.blue)),
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [Text(title), Text(subTitle), Image.network(imageStr)],
    ),
  );
}
